
# 根据需要添加驱动文件
set(b_drv_srcs
#    "babyos/bos/drivers/xxx.c"
    # "babyos/bos/drivers/b_drv_key.c"
    # "babyos/bos/drivers/b_drv_ili9341.c"
)

# 根据需要添加
set(b_mcu_srcs
#    "babyos/bos/mcu/xxx/xxxxx.c"
    "babyos/bos/mcu/espressif/esp32c3/mcu_esp32c3_uart.c"
    "babyos/bos/mcu/espressif/esp32c3/mcu_esp32c3_gpio.c"
    "babyos/bos/mcu/espressif/esp32c3/mcu_esp32c3_spi.c"
    "babyos/bos/mcu/espressif/esp32c3/mcu_esp32c3_wdt.c"
)

set(b_algo_srcs
    "babyos/bos/algorithm/algo_base64.c"
    "babyos/bos/algorithm/algo_crc.c"
    "babyos/bos/algorithm/algo_hmac_sha1.c"
    "babyos/bos/algorithm/algo_md5.c"
    "babyos/bos/algorithm/algo_sort.c"
    "babyos/bos/algorithm/algo_utf8_unicode.c"
)

set(b_core_srcs
    "babyos/bos/core/b_core.c"
    "babyos/bos/core/b_device.c"
    "babyos/bos/core/b_queue.c"
    "babyos/bos/core/b_sem.c"
    "babyos/bos/core/b_task.c"
    "babyos/bos/core/b_timer.c"
)

set(b_hal_srcs
   "babyos/bos/hal/b_hal.c"
   "babyos/bos/hal/b_hal_dma.c"
   "babyos/bos/hal/b_hal_eth.c"
   "babyos/bos/hal/b_hal_flash.c"
   "babyos/bos/hal/b_hal_gpio.c"
   "babyos/bos/hal/b_hal_i2c.c"
   "babyos/bos/hal/b_hal_it.c"
   "babyos/bos/hal/b_hal_qspi.c"
   "babyos/bos/hal/b_hal_rng.c"
   "babyos/bos/hal/b_hal_sdio.c"
   "babyos/bos/hal/b_hal_spi.c"
   "babyos/bos/hal/b_hal_uart.c"
   "babyos/bos/hal/b_hal_wdt.c"
)

set(b_modules_srcs
   "babyos/bos/modules/b_mod_netif/b_mod_trans/b_mod_lwip.c"
   "babyos/bos/modules/b_mod_netif/b_mod_trans/b_mod_socket.c"
   "babyos/bos/modules/b_mod_netif/b_mod_link.c"
   "babyos/bos/modules/b_mod_netif/b_mod_trans.c"
   "babyos/bos/modules/b_mod_adchub.c"
   "babyos/bos/modules/b_mod_button.c"
   "babyos/bos/modules/b_mod_error.c"
   "babyos/bos/modules/b_mod_fs.c"
   "babyos/bos/modules/b_mod_gui.c"
   "babyos/bos/modules/b_mod_iap.c"
   "babyos/bos/modules/b_mod_kv.c"
   "babyos/bos/modules/b_mod_menu.c"
   "babyos/bos/modules/b_mod_modbus.c"
   "babyos/bos/modules/b_mod_param.c"
   "babyos/bos/modules/b_mod_protocol.c"
   "babyos/bos/modules/b_mod_pwm.c"
   "babyos/bos/modules/b_mod_qrcode.c" 
   "babyos/bos/modules/b_mod_select.c" 
   "babyos/bos/modules/b_mod_shell.c" 
   "babyos/bos/modules/b_mod_ssl.c" 
   "babyos/bos/modules/b_mod_state.c" 
   "babyos/bos/modules/b_mod_trace.c" 
   "babyos/bos/modules/b_mod_usb.c" 
   "babyos/bos/modules/b_mod_wifi.c" 
   "babyos/bos/modules/b_mod_xm128.c" 
   "babyos/bos/modules/b_mod_ymodem.c"  
)

set(b_service_srcs
    "babyos/bos/services/b_srv_mqtt.c"
    "babyos/bos/services/b_srv_ota.c"
    "babyos/bos/services/b_srv_protocol.c"
    "babyos/bos/services/b_srv_tcpip.c"
    "babyos/bos/services/b_srv_transfile.c"
)

set(b_utils_srcs
    "babyos/bos/utils/b_util_at.c"
    "babyos/bos/utils/b_util_fifo.c"
    "babyos/bos/utils/b_util_log.c"
    "babyos/bos/utils/b_util_lunar.c"
    "babyos/bos/utils/b_util_memp.c"
    "babyos/bos/utils/b_util_uart.c"
    "babyos/bos/utils/b_util_utc.c"
)

set(b_thirdparty_lvgl_srcs
    "babyos/bos/thirdparty/lvgl/src/lv_init.c"
    "babyos/bos/thirdparty/lvgl/src/core/lv_group.c"
    "babyos/bos/thirdparty/lvgl/src/core/lv_obj.c"
    "babyos/bos/thirdparty/lvgl/src/core/lv_obj_class.c"
    "babyos/bos/thirdparty/lvgl/src/core/lv_obj_draw.c"
    "babyos/bos/thirdparty/lvgl/src/core/lv_obj_event.c"
    "babyos/bos/thirdparty/lvgl/src/core/lv_obj_id_builtin.c"
    "babyos/bos/thirdparty/lvgl/src/core/lv_obj_pos.c"
    "babyos/bos/thirdparty/lvgl/src/core/lv_obj_property.c"
    "babyos/bos/thirdparty/lvgl/src/core/lv_obj_scroll.c"
    "babyos/bos/thirdparty/lvgl/src/core/lv_obj_style.c"
    "babyos/bos/thirdparty/lvgl/src/core/lv_obj_style_gen.c"
    "babyos/bos/thirdparty/lvgl/src/core/lv_obj_tree.c"
    "babyos/bos/thirdparty/lvgl/src/core/lv_refr.c"
    "babyos/bos/thirdparty/lvgl/src/display/lv_display.c"
    "babyos/bos/thirdparty/lvgl/src/tick/lv_tick.c"
    "babyos/bos/thirdparty/lvgl/src/stdlib/lv_mem.c"
    "babyos/bos/thirdparty/lvgl/src/stdlib/babyos/lv_mem_core_babyos.c"
    "babyos/bos/thirdparty/lvgl/src/draw/lv_draw.c"
    "babyos/bos/thirdparty/lvgl/src/indev/lv_indev.c"
    "babyos/bos/thirdparty/lvgl/src/draw/lv_draw_arc.c"
    "babyos/bos/thirdparty/lvgl/src/draw/lv_draw_buf.c"
    "babyos/bos/thirdparty/lvgl/src/draw/lv_draw_image.c"
    "babyos/bos/thirdparty/lvgl/src/draw/lv_draw_label.c"
    "babyos/bos/thirdparty/lvgl/src/draw/lv_draw_line.c"
    "babyos/bos/thirdparty/lvgl/src/draw/lv_draw_mask.c"
    "babyos/bos/thirdparty/lvgl/src/draw/lv_draw_rect.c"
    "babyos/bos/thirdparty/lvgl/src/draw/lv_draw_triangle.c"
    "babyos/bos/thirdparty/lvgl/src/draw/lv_draw_vector.c"
    "babyos/bos/thirdparty/lvgl/src/draw/lv_image_decoder.c"
    "babyos/bos/thirdparty/lvgl/src/font/lv_font.c"
    "babyos/bos/thirdparty/lvgl/src/layouts/lv_layout.c"
    "babyos/bos/thirdparty/lvgl/src/layouts/flex/lv_flex.c"
    "babyos/bos/thirdparty/lvgl/src/layouts/grid/lv_grid.c"
    "babyos/bos/thirdparty/lvgl/src/misc/lv_anim.c"
    "babyos/bos/thirdparty/lvgl/src/misc/lv_anim_timeline.c"
    "babyos/bos/thirdparty/lvgl/src/misc/lv_area.c"
    "babyos/bos/thirdparty/lvgl/src/misc/lv_array.c"
    "babyos/bos/thirdparty/lvgl/src/misc/lv_async.c"
    "babyos/bos/thirdparty/lvgl/src/misc/lv_bidi.c"
    "babyos/bos/thirdparty/lvgl/src/misc/lv_color.c"
    "babyos/bos/thirdparty/lvgl/src/misc/lv_color_op.c"
    "babyos/bos/thirdparty/lvgl/src/misc/lv_event.c"
    "babyos/bos/thirdparty/lvgl/src/misc/lv_fs.c"
    "babyos/bos/thirdparty/lvgl/src/misc/lv_ll.c"
    "babyos/bos/thirdparty/lvgl/src/misc/lv_log.c"
    "babyos/bos/thirdparty/lvgl/src/misc/lv_lru.c"
    "babyos/bos/thirdparty/lvgl/src/misc/lv_math.c"
    "babyos/bos/thirdparty/lvgl/src/misc/lv_palette.c"
    "babyos/bos/thirdparty/lvgl/src/misc/lv_profiler_builtin.c"
    "babyos/bos/thirdparty/lvgl/src/misc/lv_rb.c"
    "babyos/bos/thirdparty/lvgl/src/misc/lv_style.c"
    "babyos/bos/thirdparty/lvgl/src/misc/lv_style_gen.c"
    "babyos/bos/thirdparty/lvgl/src/misc/lv_templ.c"
    "babyos/bos/thirdparty/lvgl/src/misc/lv_text.c"
    "babyos/bos/thirdparty/lvgl/src/misc/lv_text_ap.c"
    "babyos/bos/thirdparty/lvgl/src/misc/lv_timer.c"
    "babyos/bos/thirdparty/lvgl/src/misc/lv_utils.c"
    "babyos/bos/thirdparty/lvgl/src/draw/sw/lv_draw_sw.c"
    "babyos/bos/thirdparty/lvgl/src/draw/sw/lv_draw_sw_arc.c"
    "babyos/bos/thirdparty/lvgl/src/draw/sw/lv_draw_sw_border.c"
    "babyos/bos/thirdparty/lvgl/src/draw/sw/lv_draw_sw_box_shadow.c"
    "babyos/bos/thirdparty/lvgl/src/draw/sw/lv_draw_sw_fill.c"
    "babyos/bos/thirdparty/lvgl/src/draw/sw/lv_draw_sw_gradient.c"
    "babyos/bos/thirdparty/lvgl/src/draw/sw/lv_draw_sw_img.c"
    "babyos/bos/thirdparty/lvgl/src/draw/sw/lv_draw_sw_letter.c"
    "babyos/bos/thirdparty/lvgl/src/draw/sw/lv_draw_sw_line.c"
    "babyos/bos/thirdparty/lvgl/src/draw/sw/lv_draw_sw_mask.c"
    "babyos/bos/thirdparty/lvgl/src/draw/sw/lv_draw_sw_mask_rect.c"
    "babyos/bos/thirdparty/lvgl/src/draw/sw/lv_draw_sw_transform.c"
    "babyos/bos/thirdparty/lvgl/src/draw/sw/lv_draw_sw_triangle.c"
    "babyos/bos/thirdparty/lvgl/src/draw/sw/lv_draw_sw_vector.c"
    "babyos/bos/thirdparty/lvgl/src/draw/sdl/lv_draw_sdl.c"
    "babyos/bos/thirdparty/lvgl/src/font/lv_font_montserrat_14.c"
    "babyos/bos/thirdparty/lvgl/src/themes/lv_theme.c"
    "babyos/bos/thirdparty/lvgl/src/libs/bin_decoder/lv_bin_decoder.c"
    "babyos/bos/thirdparty/lvgl/src/osal/lv_os_none.c"
    "babyos/bos/thirdparty/lvgl/src/stdlib/clib/lv_mem_core_clib.c"
    "babyos/bos/thirdparty/lvgl/src/stdlib/clib/lv_sprintf_clib.c"
    "babyos/bos/thirdparty/lvgl/src/stdlib/clib/lv_string_clib.c"
    "babyos/bos/thirdparty/lvgl/src/stdlib/builtin/lv_mem_core_builtin.c"
    "babyos/bos/thirdparty/lvgl/src/stdlib/builtin/lv_sprintf_builtin.c"
    "babyos/bos/thirdparty/lvgl/src/stdlib/builtin/lv_string_builtin.c"
    "babyos/bos/thirdparty/lvgl/src/stdlib/builtin/lv_tlsf.c"
    "babyos/bos/thirdparty/lvgl/src/indev/lv_indev_scroll.c"
    "babyos/bos/thirdparty/lvgl/src/misc/cache/_lv_cache_lru_rb.c"
    "babyos/bos/thirdparty/lvgl/src/misc/cache/lv_cache.c"
    "babyos/bos/thirdparty/lvgl/src/misc/cache/lv_cache_entry.c"
    "babyos/bos/thirdparty/lvgl/src/misc/cache/lv_image_cache.c"
    "babyos/bos/thirdparty/lvgl/src/themes/default/lv_theme_default.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/bar/lv_bar.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/line/lv_line.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/led/lv_led.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/win/lv_win.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/tileview/lv_tileview.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/textarea/lv_textarea.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/tabview/lv_tabview.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/table/lv_table.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/switch/lv_switch.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/spinner/lv_spinner.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/spinbox/lv_spinbox.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/span/lv_span.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/slider/lv_slider.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/scale/lv_scale.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/roller/lv_roller.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/msgbox/lv_msgbox.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/menu/lv_menu.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/list/lv_list.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/label/lv_label.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/keyboard/lv_keyboard.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/imagebutton/lv_imagebutton.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/image/lv_image.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/dropdown/lv_dropdown.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/checkbox/lv_checkbox.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/chart/lv_chart.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/canvas/lv_canvas.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/calendar/lv_calendar.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/calendar/lv_calendar_header_arrow.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/calendar/lv_calendar_header_dropdown.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/buttonmatrix/lv_buttonmatrix.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/button/lv_button.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/arc/lv_arc.c"
    "babyos/bos/thirdparty/lvgl/src/widgets/animimage/lv_animimage.c"
    "babyos/bos/thirdparty/lvgl/src/themes/mono/lv_theme_mono.c"
    "babyos/bos/thirdparty/lvgl/src/themes/simple/lv_theme_simple.c"
    "babyos/bos/thirdparty/lvgl/src/draw/sw/blend/lv_draw_sw_blend_to_rgb565.c"
    "babyos/bos/thirdparty/lvgl/src/font/lv_font_fmt_txt.c"
    "babyos/bos/thirdparty/lvgl/src/draw/sw/blend/lv_draw_sw_blend.c"
    "babyos/bos/thirdparty/lvgl/src/draw/sw/blend/lv_draw_sw_blend_to_argb8888.c"
    "babyos/bos/thirdparty/lvgl/src/draw/sw/blend/lv_draw_sw_blend_to_rgb888.c"
)

set(b_thirdparty_srcs
    # "babyos/bos/thirdparty/nr_micro_shell/src/ansi_port.c"
    # "babyos/bos/thirdparty/nr_micro_shell/src/ansi.c"
    # "babyos/bos/thirdparty/nr_micro_shell/src/nr_micro_shell.c"
    # "babyos/bos/thirdparty/flexiblebutton/flexible_button.c"
    # ${b_thirdparty_lvgl_srcs}
)

set(babyos_srcs
    ${b_drv_srcs}
    ${b_mcu_srcs}
    ${b_algo_srcs}
    ${b_core_srcs}
    ${b_hal_srcs}
    ${b_modules_srcs}
    ${b_service_srcs}
    ${b_utils_srcs}
    ${b_thirdparty_srcs}
)

set(
    babyos_include
    "_config"
    "babyos/bos"
)

idf_component_register(
    SRCS ${babyos_srcs} 
    WHOLE_ARCHIVE
    INCLUDE_DIRS ${babyos_include}
    REQUIRES soc hal driver
)

target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-char-subscripts)
target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-sequence-point)
